package StudyCode.summary.mycollection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class TrimsTheStringContentOnAnArrayOfString {
	public static void main(String[] argv) {
		String array = "www.tah1986.com  ";
		System.out.println(java.util.Arrays.toString(trimArray(array)));
	}

	public static String[] trimArray(final String... array) {
		String[] retval = null;
		if (array != null) {
			retval = new String[array.length];
			System.arraycopy(array, 0, retval, 0, array.length);
			for (int i = 0; i < retval.length; i++) {
				if (array[i] == null) {
					retval[i] = array[i];
				} else {
					retval[i] = array[i].trim();
				}
			}

		}
		return retval;
	}
}
